// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require("base");
	var dialog = require("dialog");
	var enterpriseId;
	
	var init = function(page) {
		enterpriseId = base.getUrlParam("enterpriseId");
		inquireEnterpriseBusinessInfoById(enterpriseId);
		
		initevent();
	};
	var initevent = function() {
		//若未登录，则返回登陆页面
//		if(base.getData("sid")==null||base.getData("sid")==""||base.getData("sid")==undefined){
//			top.location.href="../login/login.html";
//		}
//		
		$(".icon-cog").unbind("click").click(function(){
			location.href = "../businessInfo/system.html?enterpriseId=" + enterpriseId;
		});
		
	};
	
	var inquireEnterpriseBusinessInfoById = function() {
		base.fnAjax({
			action: "inquireEnterpriseBusinessInfoById.json", //接口名称
			oData: {
				enterpriseId: enterpriseId
			}, //传递参数
			fnSuccess: function(data) { //成功回调
				if (data.status == 200) {
					var tpl = $(".adminTpl").html();
					var html = juicer(tpl, data);
					$(".admin").html(html);
				}
			}
		});
	};
	
	var inquireEnterpriseDetail = function() {
		base.fnAjax({
			action: "inquireEnterpriseDetail.json", //接口名称
			oData: {
				enterpriseId: enterpriseId
			}, //传递参数
			fnSuccess: function(data) { //成功回调
				if (data.status == 200) {
					
				}
			}
		});
	};
	
	return {
		init: init
	};
});